-- local webserver = commonlib.StartWebServer();
-- webserver:Get("/test", function(ctx)
--     commonlib.echo(ctx:GetParams())
--     ctx:Send({key = 1});
-- end)

commonlib.SetTimeout(1000, function()
    -- commonlib.GetUrl({
    --     method = "GET",
    --     url = "http://localhost/test?a=1",
    --     qs = {
    --         key = "你好",
    --         value = 2,
    --     },
    --     callback = function(status_code, data, headers)
    --         print(status_code);
    --         commonlib.echo(data)
    --         commonlib.echo(headers)
    --     end,
    -- });

--     commonlib.SendMail({
--         url = "smtp.mxhichina.com:25",
--         username = "noreply@wxaxiaoyao.cn",
--         password = "wxa@765485868",
--         from = "<noreply@wxaxiaoyao.cn>",
--         to = "<765485868@qq.com>",
--         text = [[
-- Date: Mon, 29 Nov 2021 21:54:29 +110
-- To: 逍遥 <765485868@qq.com>
-- From: 逍遥笔记 <noreply@wxaxiaoyao.cn>
-- Cc: <765485868@qq.com>
-- Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>
-- Subject: 验证码-逍遥笔记

-- <div style="padding:30px">
--     <div style="font-size:26px; color:#909399; text-align: center">验证码: 7498 请在10分钟内完成验证</div>
-- </div>
-- ]]
--     });

    commonlib.Download({url = "http://www.baidu.com", filename = "D:/test.html"});
end);

-- MainLoop();
-- print("-------------------------exit------------------------------")

-- local filename = "D:\\workspace\\lua\\test.jpg";

-- local file = io.open(filename, "rb");
-- print("----------", file)
-- local text = file:read("a");

-- file:close();

-- test_func(text);
